package com.huawei.appgallery.appcomment.ui.view;

import android.content.Context;
import android.util.AttributeSet;
import com.huawei.appgallery.foundation.ui.css.CSSRule;
import com.huawei.appgallery.foundation.ui.css.CSSViewProxy;
import com.huawei.appgallery.foundation.ui.css.RenderListener;
import com.huawei.appgallery.foundation.ui.css.adapter.CSSPropertyName;
import com.huawei.appgallery.foundation.ui.css.adapter.type.CSSMonoColor;
import com.huawei.appgallery.foundation.ui.css.adapter.type.CSSValue;
import huawei.widget.HwSpinner;

public class SortSpinner extends HwSpinner implements RenderListener {
    private d ˊ = null;
    private boolean ˋ = false;
    private int ˎ;
    private e ˏ;

    public interface d {
        void ˊ();
    }

    public interface e {
        void ॱ(int i);
    }

    public SortSpinner(Context context) {
        super(context);
    }

    public SortSpinner(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    public SortSpinner(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
    }

    public void setRenderReadyListener(e eVar) {
        this.ˏ = eVar;
    }

    public boolean onRenderReady(CSSViewProxy cSSViewProxy) {
        this.ˋ = true;
        CSSRule rule = cSSViewProxy.getRule();
        if (rule.getStyleDeclaration() != null) {
            CSSValue propertyValue = rule.getStyleDeclaration().getPropertyValue(CSSPropertyName.FONT_COLOR);
            if (propertyValue != null && (propertyValue instanceof CSSMonoColor)) {
                this.ˎ = ((CSSMonoColor) propertyValue).getColor();
                if (this.ˏ != null) {
                    this.ˏ.ॱ(this.ˎ);
                }
            }
        }
        return false;
    }

    public boolean performClick() {
        boolean performClick = super.performClick();
        if (this.ˊ != null) {
            this.ˊ.ˊ();
        }
        return performClick;
    }

    public void setExtendClick(d dVar) {
        this.ˊ = dVar;
    }
}
